package com.imooc.imoocbilibili.interceptor;


import com.imooc.imoocbilibili.entity.User;

public class ThreadUser {
    private static final ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static void set(User user) {
        ThreadUser.threadLocal.set(user);
    }

    public static void clear() {
        ThreadUser.threadLocal.remove();
    }

    public static User getUser() {
        return ThreadUser.threadLocal.get();
    }
}
